package chances.epg.commons.utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;

public class PropertiesUtils {
	 static List<File> configFiles = new ArrayList<File>();

	public static Map<String, Object> loadConfig(File file) throws IOException {
		Map<String, Object> maps = new HashMap<String, Object>();
		if(file.exists()) {
			Properties props = new Properties();
			props.load(new FileInputStream(file));
			Set<Entry<Object, Object>> values = props.entrySet();
			for (Entry<Object, Object> entry : values) {
				maps.put((String) entry.getKey(), entry.getValue());
			}
		}
		return maps;
	}

}
